<?php

/**
 * general actions.
 *
 * @package    Redsea20
 * @subpackage general
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class generalActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    $this->forward('default', 'module');
  }

  /*
   * Gets the list of RBIS members according to passed param and refresh the value
   * on the screen
   */
  public function executeRefreshRBISCommunityList(sfWebRequest $request) {
      $userType = $request->getParameter('uType');
      $userId = $request->getParameter('uid');

      if(isset ($userId))
          $userId = RBISUtility::decryptURLParamValue ($userId);

      /*
       * If user type (param value) is not set then show all community members
       * display requested group members
       */
      $memberList = Entity::getRBISCommunity($userType, $userId);

      foreach ($memberList as $member) {
          echo '<tr>';
          echo '<td class="paddingLeft10">';
          echo '<a href="'.$this->getController()->genUrl('home/userProfile?id='.RBISUtility::encryptURLParamValue($member->getId())).'">' . $member->getFullname().'</a>';
          echo '</td>';
          echo '</tr>';
      }
      return sfView::NONE;
  }

  public function executeHelp(sfWebRequest $request) {
      
  }

  public function executeAbout($request) {
        
  }

  public function executeTermsofuse($request) {
      
  }

  public function executeOffline($request) {
    return $this->renderText("RBIS is temporarily inaccessible for public");
}
}
